import React, { Component } from 'react'
function Children(props) {
    let { children, displays } = props;
    return (
        <ul>
            <li style={{ display: displays ? 'block' : 'none' }}>{children}</li>
        </ul>
    )
}
class Aside extends Component {
    constructor(props) {
        super(props);
        this.state = {
            display: false
        };
    }
    render() {
        return (
            <div>
                {
                    this.props.ground.map((item, index) => (
                        <div key={index}>
                            <p key={index}
                                onClick={() => this.handleClick(item.isShow, index)} >{item.title}
                            </p>
                            {
                                item.children.map((items, index) => (
                                    <Children children={items.content}
                                        displays={item.isShow}></Children>
                                ))
                            }
                        </div>
                    ))
                }
            </div>
        );
    }
    handleClick = (shows, ind) => {
        this.setState({
        })
        this.props.ground[ind].isShow = !this.props.ground[ind].isShow
    }
}
export default Aside;